/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package library.ucm;

import library.model.ButtonModel_DD;
import library.view.DeliveryDesk;

/**
 *
 * @author Donghui
 */
public class SetDeliveryDeskValue {

    private static SetDeliveryDeskValue local;
    private ButtonModel_DD button;
    private String tp;
    private String[] spliter;
    private String pid;
    private String name;

    public static SetDeliveryDeskValue getInstance(String tp)
    {
        if(local==null)
        {
            local=new SetDeliveryDeskValue();
            local.tp=tp;
        }
        else
        {
            local.tp=tp;
        }
        return local;
    }

    public void setValue()
    {
        spliter=tp.split(";");
        pid=spliter[1];
        System.out.println(pid);
        name=spliter[2];
                System.out.println(name);
        button=DeliveryDesk.getInstance().getButtonModel();
        button.getPid().setText(pid);
        button.getName().setText(name);
        button.getRDate().setText(ShowDate.getInstance().getExpDate());
    }

    public void setNull()
    {
        button=DeliveryDesk.getInstance().getButtonModel();
        button.getPid().setText("N/A");
        button.getName().setText("N/A");
        button.getRDate().setText("N/A");
    }









}
